package org.semanticflash.rdf.values
{
	
	
	
	// abstract
	public class RDFLiteral extends RDFValue
	{
		
		
		private var _lexicalValue:String;
		
		
		public function get lexicalValue( ):String
		{
			return _lexicalValue;
		}
		

		
		public function RDFLiteral( lexicalValue:String )
		{
			_lexicalValue = lexicalValue;
		}
		
		

		
		// cache for performance
		private var _nt:String;

		override public function get nt( ):String
		{
		
			if ( !_nt )
			{
			    _nt = this.lexicalValue;
			    _nt = _nt.replace( /\\/g , '\\\\' );
			    _nt = _nt.replace( / \" /xg , '\\"' );
			    _nt = '"' + _nt + '"';
			}
			
		    return _nt;			
		
		}
		
	}
	
}